package hngc.com;

import java.util.Scanner;

public class Box7 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = 0;
        int b = 0;
        double c = 0;
        System.out.println("输入a的值：");
        while (scanner.hasNext()){
            try {
                a = scanner.nextInt();
                System.out.println("输入b的值：");
            }catch (Exception e){
                System.out.println("必须输入非零的整数");
                return;
            }
        }
        if (a != 0 && b != 0){
            if (a > 0 && b > 0){
                c=Math.sin(a+b*10);
                System.out.println("算式一值："+c);
                System.out.println("c:"+c);
            }else{
                if(a<0&&b<0){
                    c= Math.pow((a*b), 3);
                    System.out.println("算式二值："+c);
                    System.out.println("c:" + c);
                }else{
                    c = Math.pow((a-b), 2);
                    System.out.println("算式三值："+c);
                    System.out.println("c:"+c);
                }
            }
        }else {
            System.out.println("必须输入非零的整数");
        }
        scanner.close();
    }
}
